package model;
// default package

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Tshoplist entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "tshoplist", catalog = "test")
public class Tshoplist implements java.io.Serializable {

	// Fields

	private String id;
	private Treceipt treceipt;
	private Tgood tgood;
	private Integer amount;
	private Double price;
	private Set<Tsalereturnitem> tsalereturnitems = new HashSet<Tsalereturnitem>(0);

	// Constructors

	/** default constructor */
	public Tshoplist() {
	}

	/** minimal constructor */
	public Tshoplist(String id) {
		this.id = id;
	}

	/** full constructor */
	public Tshoplist(String id, Treceipt treceipt, Tgood tgood, Integer amount, Double price, Set<Tsalereturnitem> tsalereturnitems) {
		this.id = id;
		this.treceipt = treceipt;
		this.tgood = tgood;
		this.amount = amount;
		this.price = price;
		this.tsalereturnitems = tsalereturnitems;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "tid")
	public Treceipt getTreceipt() {
		return this.treceipt;
	}

	public void setTreceipt(Treceipt treceipt) {
		this.treceipt = treceipt;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "goodid")
	public Tgood getTgood() {
		return this.tgood;
	}

	public void setTgood(Tgood tgood) {
		this.tgood = tgood;
	}

	@Column(name = "amount")
	public Integer getAmount() {
		return this.amount;
	}

	public void setAmount(Integer amount) {
		this.amount = amount;
	}

	@Column(name = "price", precision = 255)
	public Double getPrice() {
		return this.price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tshoplist")
	public Set<Tsalereturnitem> getTsalereturnitems() {
		return this.tsalereturnitems;
	}

	public void setTsalereturnitems(Set<Tsalereturnitem> tsalereturnitems) {
		this.tsalereturnitems = tsalereturnitems;
	}

}